package vn.fsoft.gst.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import vn.fsoft.gst.dao.SupportingMaterialDAO;
import vn.fsoft.gst.domain.SupportingMaterial;

/**
 * This SupportingMaterialServiceImpl class implement SupportingMaterialService
 * interface
 * 
 * @author TienNM
 *
 */
@Service
public class SupportingMaterialServiceImpl implements SupportingMaterialService {

	@Autowired
	private SupportingMaterialDAO suppMaterialDao;

	@Transactional
	public int addSupportingMaterial(SupportingMaterial supportingMaterial) {
		return suppMaterialDao.addSupportingMaterial(supportingMaterial);
	}

	@Transactional
	public void editSupportingMaterial(SupportingMaterial supportingMaterial) {
		suppMaterialDao.editSupportingMaterial(supportingMaterial);
	}

	@Transactional
	public void deleteSupportingMaterial(int Id) {
		suppMaterialDao.deleteSupportingMaterial(Id);
	}

	@Transactional
	public List<SupportingMaterial> getAll() {
		return suppMaterialDao.getAll();
	}

	@Transactional
	public void activeSupportingMaterial(int Id) {
		suppMaterialDao.activeSupportingMaterial(Id);

	}

	@Transactional
	public SupportingMaterial getById(int Id) {
		return suppMaterialDao.getById(Id);
	}

	@Transactional
	public List<SupportingMaterial> getByOrg(int orgID) {
		return suppMaterialDao.getByOrg(orgID);
	}

}
